package com.haixiaoke.saas.repository.service.impl;

import cn.hutool.core.date.DateUtil;
import com.haixiaoke.saas.repository.mapper.BacklogItemMapper;
import com.haixiaoke.saas.repository.pojo.BacklogItem;
import com.haixiaoke.saas.repository.service.IBacklogItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 操作办事项表Service业务层处理
 * 
 * @author panda
 * @date 2023-07-27
 */
@Service
public class BacklogItemServiceImpl implements IBacklogItemService {
    @Autowired
    private BacklogItemMapper backlogItemMapper;

    /**
     * 查询操作办事项表
     * 
     * @param id 操作办事项表主键
     * @return 操作办事项表
     */
    @Override
    public BacklogItem selectBacklogItemById(Long id) {
        return backlogItemMapper.selectBacklogItemById(id);
    }

    /**
     * 查询操作办事项表列表
     * 
     * @param backlogItem 操作办事项表
     * @return 操作办事项表
     */
    @Override
    public List<BacklogItem> selectBacklogItemList(BacklogItem backlogItem) {
        return backlogItemMapper.selectBacklogItemList(backlogItem);
    }

    /**
     * 新增操作办事项表
     * 
     * @param backlogItem 操作办事项表
     * @return 结果
     */
    @Override
    public int insertBacklogItem(BacklogItem backlogItem) {
        backlogItem.setCreateTime(DateUtil.date());
        return backlogItemMapper.insertBacklogItem(backlogItem);
    }

    /**
     * 修改操作办事项表
     * 
     * @param backlogItem 操作办事项表
     * @return 结果
     */
    @Override
    public int updateBacklogItem(BacklogItem backlogItem) {
        return backlogItemMapper.updateBacklogItem(backlogItem);
    }

    /**
     * 批量删除操作办事项表
     * 
     * @param ids 需要删除的操作办事项表主键
     * @return 结果
     */
    @Override
    public int deleteBacklogItemByIds(Long[] ids) {
        return backlogItemMapper.deleteBacklogItemByIds(ids);
    }

    /**
     * 删除操作办事项表信息
     * 
     * @param id 操作办事项表主键
     * @return 结果
     */
    @Override
    public int deleteBacklogItemById(Long id) {
        return backlogItemMapper.deleteBacklogItemById(id);
    }

    @Override
    public int insertBacklogItems(List<BacklogItem> backlogItems) {
        return backlogItemMapper.insertBacklogItems(backlogItems);
    }
}
